<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>登录——热带农产品质量安全风险评估实验室信息共享数据库</title>
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 14px;
	background-color: #1D3647;
}
-->
</style>
		<script language="JavaScript">
function correctPNG()
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) 
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}
window.attachEvent("onload", correctPNG);
</script>
		<link rel="stylesheet" type="text/css"
			href="./module/validation/css/login-validate.css" />
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript" src="ui/om-validate.js"></script>
		<script type="text/javascript" src="ui/om-ajaxsubmit.js"></script>
		<!-- view_source_begin -->
		<script type="text/javascript">
		$(document).ready(function() {
		     //点击刷新验证码功能
		     $('#loginForm img').click(function(){
		         //因为浏览器默认会缓存图片，所以只要改变url就可以跳过缓存
		         //每次在url后面添加随机数就可以保证url不重复
		         this.src='validateCode.image?'+new Date().getTime();
		     });
		     $("#loginForm").validate({
		          errorLabelContainer : "#errorMessages",
		          rules : {
                    username : "required",
                    password : "required",
                    validatecode : "required"
                  },
                  messages : {
                    username : {required : "请输入用户名！"},
                    password : {required : "请输入密码！"},
                    validatecode : {required : "请输入验证码！"}
                  },
                  submitHandler : function(){
                    //以ajax方式到后台进行登录
                    $("#loginForm").omAjaxSubmit({
                        url :'login.do',
                        beforeSubmit:function(){
                            //登录前为登录按钮添加loading效果
                            $('#login').addClass('status'); 
                        },
                        success:function(responseText,statusText, xhr, $form){
                            //登录后不管成功还是失败都去掉登录按钮的loading效果
                            $('#login').removeClass('status');
                            //如果登录成功转到主页面，如果登录失败把错误信息显示出来
                            if(responseText=='1'){
                                self.location.href='main.html';
                            }else if(responseText == '2'){
                            	self.location.href='user.html';
                            }else{
                                alert(responseText);
                            }
                        }
                    });
                    return false;
                  }
		     });
		});
	</script>
		<!-- view_source_end -->

		<link href="images/skin.css" rel="stylesheet" type="text/css">
	</head>
	<body>
		<table width="100%" height="100%" border="0" cellpadding="0"
			cellspacing="0">
			<tr height="95%">
				<td valign="top">
					<table width="100%" height="532" border="0" cellpadding="0"
						cellspacing="0" class="login_bg">
						<tr>
							<td width="50%" align="right">
								<table width="91%" height="532" border="0" cellpadding="0"
									cellspacing="0" class="login_bg2">
									<tr>
										<td height="138" valign="top">
											<table width="89%" height="427" border="0" cellpadding="0"
												cellspacing="0">
												<tr>
													<td height="80" align="right">
														<img src="images/logo1.png">
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							<td width="50%" valign="bottom">
								<table width="100%" height="59" border="0" align="center"
									cellpadding="0" cellspacing="0">
									<tr>
										<td>
											&nbsp;
										</td>
										<td height="21">
											<table cellSpacing="0" cellPadding="0" width="100%"
												border="0" id="table211" height="328">
												<tr>
													<td height="80">
														<img src="images/logo1-1.png" style="margin-left: 30px;">
													</td>
												</tr>
												<tr>
													<td height="164">
														<div style="padding-left: 30px;">
															<form id="loginForm" name="loginform" action="index.html"
																method="post">

																<div style="padding: 15px 0px 0px 0px;">
																	<span class="login_txt">用&nbsp;户&nbsp;名：&nbsp;&nbsp;&nbsp;&nbsp;
																	</span>
																	<input name="username" class="editbox4" />
																</div>
																<div style="padding: 15px 0px 0px 0px;">
																	<span class="login_txt">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：&nbsp;&nbsp;&nbsp;&nbsp;</span>
																	<input class="editbox4" type="password" name="password" />
																	<img src="images/luck.gif" width="19" height="18">
																</div>
																<div style="padding: 15px 0px 0px 0px;">
																	<span class="login_txt">验&nbsp;证&nbsp;码：&nbsp;&nbsp;&nbsp;&nbsp;</span>
																	<input class=wenbenkuang name="validatecode" type=text
																		value="" maxLength=6 size=10 />
																	<img src="validateCode.image" title="点击刷新验证码" />
																</div>
																<div style="padding: 15px 0px 0px 60px;">
																	<input class="login_txt" name="usertype" type="radio"
																		value="1" checked>
																	管理员
																	</input>
																	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
																	<input class="login_txt" name="usertype" type="radio"
																		value="2">
																	普通用户
																	</input>
																</div>
																<div style="padding: 15px 0px 0px 60px;">
																	<input name="Submit" type="submit" id="login"
																		class="button" id="Submit" value="登 陆">
																	<input name="cs" type="reset" class="button" id="cs"
																		value="取 消" onClick="showConfirmMsg1()">
																	<a href="registe.html">点击注册</a>
																</div>
															</form>
														</div>
													</td>
												</tr>
												<tr>
													<td width="433" height="164" align="right" valign="bottom">
														<img src="images/login-wel.gif" width="242" height="138">
													</td>
													<td width="57" align="right" valign="bottom">
														&nbsp;
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr height="20">
				<td align="center">
					<span class="login-buttom-txt">Copyright &copy;
						2012&nbsp;&nbsp;热带农产品质量安全风险评估实验室</span>
				</td>
			</tr>
		</table>
	</body>
</html>